//
//  DetailInfoTableViewCell.m
//  e-Learning
//
//  Created by rimi on 16/6/29.
//  Copyright © 2016年 YJ. All rights reserved.
//

#import "DetailInfoTableViewCell.h"

#define WIDTH Screen_Width/3
#define HEIGHT Screen_Height/8*7*0.9/2/2


@implementation DetailInfoTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.titleBtn];
        [self.contentView addSubview:self.name];
        [self.contentView addSubview:self.time];
        [self.contentView addSubview:self.student];
        [self.contentView addSubview:self.star];
        [self.contentView addSubview:self.discuss];
    }
    return self;
}

- (UIButton *)titleBtn{
    if (!_titleBtn) {
        _titleBtn = [[UIButton alloc] initWithFrame:CGRectMake(WIDTH*0.1, HEIGHT*0.1, WIDTH*0.8, HEIGHT*0.3)];
        _titleBtn.layer.borderColor = [UIColor whiteColor].CGColor;
        _titleBtn.layer.borderWidth = 1;
        [_titleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    }
    return _titleBtn;
}

- (UILabel *)name{
    if (!_name) {
        _name = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.12, HEIGHT*0.5, WIDTH/2, HEIGHT*0.1)];
        _name.textColor = [UIColor whiteColor];
    }
    return _name;
}

- (UILabel *)time{
    if (!_time) {
        _time = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.5, HEIGHT*0.5, WIDTH/2, HEIGHT*0.1)];
        _time.textAlignment = NSTextAlignmentRight;
        _time.textColor = [UIColor whiteColor];

    }
    return _time;
}

- (UILabel *)student{
    if (!_student) {
        _student = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.12, HEIGHT*0.65, WIDTH/2, HEIGHT*0.1)];
        _student.textColor = [UIColor whiteColor];
        
    }
    return _student;
}

- (UILabel *)star{
    if (!_star) {
        _star = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH*0.12, HEIGHT*0.8, WIDTH/2, HEIGHT*0.1)];
    }
    return _star;
}

- (UILabel *)discuss{
    if (!_discuss) {
        _discuss = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH/2, HEIGHT*0.8, WIDTH/2, HEIGHT*0.1)];
        _discuss.textColor = [UIColor whiteColor];
        _discuss.textAlignment = NSTextAlignmentRight;
    }
    return _discuss;
}







- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
